package com.czbank.financing.controller;

import com.czbank.financing.Entity.Mapping;
import com.czbank.financing.service.MappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userInfo")
public class MappingController {

    @Autowired
    private MappingService mappingService;


    @RequestMapping("/SelectOneMapping")
    public Object getMappingOne(long id){

        return mappingService.selectMappingById(id);
    }

    @RequestMapping("/DeleteOneMapping")
    public Object deleteMappingOne(long id){

        return mappingService.deleteMapping(id);
    }

    @RequestMapping("/updataOneMapping")
    public Object updataMappingOne(Mapping mapping){

        return mappingService.updateMapping(mapping);
    }

    @RequestMapping("/insertOneMapping")
    public Object insertMappingOne(Mapping mapping){

        return mappingService.addMapping(mapping);
    }
}
